home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Memphis Amiga Group / MAG DOS 2.0 Utilities Disk 01 (1991-09)(Memphis Amiga Group).zip / MAG DOS 2.0 Utilities Disk 01 (1991-09)(Memphis Amiga Group).adf / PointerX / PointerX.c < prev    next >
C/C++ Source or Header  |  1991-08-16  |  961b  |  48 lines

  1. #include <intuition/intuitionbase.h>
  2. #include <dos/dos.h>
  3.  
  4. int CXBRK(void) { return(0); }
  5. void MemCleanup(void) { }
  6.  
  7. struct IntuitionBase *IntuitionBase;
  8. struct GfxBase *GfxBase;
  9.  
  10. extern short *Pointers[];
  11.  
  12. main()
  13. {
  14. int x=0;
  15. int OldPri;
  16. struct Process *Me;
  17.  
  18. Me=(struct Process *)FindTask(0);
  19. OldPri=SetTaskPri(Me, 20);
  20.  
  21. IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",36);
  22. GfxBase=(struct GfxBase *)OpenLibrary("graphics.library", 36);
  23. if (IntuitionBase==0 || GfxBase==0)
  24.     return(0);
  25.  
  26. while (!(SetSignal(0,0)&SIGBREAKF_CTRL_C))
  27.     {
  28.     struct Window *Win;
  29.  
  30.     WaitTOF();
  31.     WaitTOF();
  32.  
  33.     Win=IntuitionBase->ActiveWindow;
  34.  
  35.     if (Win && Win->Pointer)
  36.         {
  37.         if (Win->PtrHeight==16 && Win->PtrWidth==16 && Win->XOffset==-6 && Win->YOffset==0 && Win->Pointer[2]==0x400 && Win->Pointer[3]==0x7c0)
  38.             CopyMem(Pointers[x], &Win->Pointer[2], 64);
  39.         };
  40.     x++;
  41.     if (x==32) x=0;
  42.     };
  43.  
  44. SetTaskPri(Me, OldPri);
  45. CloseLibrary(IntuitionBase);
  46. CloseLibrary(GfxBase);
  47. }
  48.